package com.labor.job;

import org.quartz.Scheduler;
import org.quartz.SchedulerException;

import com.labor.job.config.JobConfiguration;

/**
 * @File: com.labor.job.JobScheduler.java
 * @Description: 
 *			负责对调度服务公共定义规范
 * @author: Peng.Gao
 * @Email: ronan.gao@vipshop.com
 */
public interface JobScheduler {

	/**
	 * @Name: getCurrentScheduler
	 * @Description: 
	 *			获取当前的业务的调度器
	 * @return
	 * @throws SchedulerException
	 */
	public Scheduler getCurrentScheduler() throws SchedulerException;
	
	/**
	 * @Name: flushJobScheduler
	 * @Description: 
	 *			根据配置信息，对当前调度器，更新或者新增一个JOB信息
	 * @param configuration JOB基础配置信息
	 * @throws SchedulerException
	 */
	public void flushJobScheduler(JobConfiguration configuration) throws SchedulerException;
	
	/**
	 * @Name: convertToJobConfiguration
	 * @Description: 
	 *			转换一个记录配置信息到JOB的配置信息
	 * @param configuration
	 * @return
	 * @throws ClassCastException
	 */
	public JobConfiguration convertToJobConfiguration(Object configuration) throws ClassCastException;

}
